package com.wuda.segmentation;

/**
 * Analyzer internal token
 */
public class Token {
	/**
	 * Character array containing token text
	 */
	private char[] charArray;
	/**
	 * start offset into original sentence
	 */
	private int startOffset;
	/**
	 * end offset into original sentence
	 */
	private int endOffset;

	/**
	 * Create a new token from a character array.
	 * 
	 * @param charArray
	 *            character array containing text
	 * @param startOffset
	 *            start offset of token in original sentence
	 * @param endOffset
	 *            end offset of token in original sentence
	 */
	public Token(char[] charArray, int startOffset, int endOffset) {
		this.charArray = charArray;
		this.startOffset = startOffset;
		this.endOffset = endOffset;
	}

	/**
	 * get the start offset of token in original sentence
	 * 
	 * @return start offset
	 */
	public int getStartOffset() {
		return startOffset;
	}

	/**
	 * get the end offset of token in original sentence
	 * 
	 * @return end offset
	 */
	public int getEndOffset() {
		return endOffset;
	}

	/**
	 * Character array containing token text
	 * 
	 * @return Character array
	 */
	public char[] getCharArray() {
		return charArray;
	}

}
